package com.example.bootdemo5.controller;

import com.example.bootdemo5.common.CommonResult;
import com.example.bootdemo5.util.RedisServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RoleController {

    @Autowired
    RedisServiceUtil   redisServiceUtil;


    @GetMapping("/roles/{id}")
    public CommonResult queryRoles(@PathVariable("id") Long id){
       Boolean  bool = redisServiceUtil.hexists("","");
       if(bool){
           redisServiceUtil.hget("","");
       }else{
           //去数据库拿
           redisServiceUtil.hset("","","");
       }
        return null;
    }

}
